<cfsetting enablecfoutputonly="true">
<cfoutput>
	<cfset this_rand = DateFormat(Now(), "yyyymmdd")&"-"&TimeFormat(Now(), "HHMMSS")>
	<h1>#this_rand#</h1>
</cfoutput>
<!--- ColdFusion's cfhttp object is specifically designed to create a post,
and retrieve the results.  Those results are accessed in cfhttp.filecontent --->
<!--- By default, this sample code is designed to post to our test server
for developer accounts: https://test.authorize.net/gateway/transact.dll
for real accounts (even in test mode), please make sure that you are\posting to: https://secure.authorize.net/gateway/transact.dll --->
<cfhttp method="Post" url="https://secure.authorize.net/gateway/transact.dll">
	<!--- the API Login ID and Transaction Key must be replaced with valid values --->
	<cfhttpparam type="Formfield" name="x_login" value="49STb2wD">
	<cfhttpparam type="Formfield" name="x_tran_key" value="4de7qW9KWt2792T9">
	<cfhttpparam type="Formfield" name="x_test_request" value="TRUE">
   
	<cfhttpparam type="Formfield" name="x_delim_data" value="TRUE">
	<cfhttpparam type="Formfield" name="x_delim_char" value="|">
	<cfhttpparam type="Formfield" name="x_relay_response" value="FALSE">

	<cfhttpparam type="Formfield" name="x_type" value="AUTH_CAPTURE">
	<cfhttpparam type="Formfield" name="x_method" value="CC">
	<cfhttpparam type="Formfield" name="x_card_num" value="4111111111111111">
	<cfhttpparam type="Formfield" name="x_exp_date" value="0115">

	<cfhttpparam type="Formfield" name="x_amount" value="19.99">
	<cfhttpparam type="Formfield" name="x_description" value="Brians Sample Transaction">

	<cfhttpparam type="Formfield" name="x_first_name" value="John #this_rand#">
	<cfhttpparam type="Formfield" name="x_last_name" value="Doe #this_rand#">
	<cfhttpparam type="Formfield" name="x_address" value="1234 Street #this_rand#">
	<cfhttpparam type="Formfield" name="x_state" value="WA">
	<cfhttpparam type="Formfield" name="x_zip" value="98004">
	<!--- Additional fields can be added here as outlined in the AIM integration
	guide at: http://developer.authorize.net --->	
	<!--- The following fields show an example of how to include line item details, they are commented out by default.
	<cfhttpparam type="Formfield" name="x_line_item" value="item1<|>golf balls<|><|>2<|>18.95<|>Y">
	<cfhttpparam type="Formfield" name="x_line_item" value="item2<|>golf bag<|>Wilson golf carry bag, red<|>1<|>39.99<|>Y">
	<cfhttpparam type="Formfield" name="x_line_item" value="item3<|>book<|>Golf for Dummies<|>1<|>21.99<|>Y">
	--->
</cfhttp>
<cflog log="dyd_charge_log" text="#cfhttp.filecontent#">
<!--- Because coldfusion's ListToArray object ignores empty fields, we must
put a space in all empty fields to make sure that they are not skipped --->
<cfset post_response=Replace(cfhttp.filecontent,"||","| |", "all")>
<!--- the same command is run twice, because the first time it only adjusts
every other empty field --->
<cfset post_response=Replace(post_response,"||","| |", "all")>

<!--- now the ListToArray method can be used without skipping fields --->
<cfset response_array=ListToArray(post_response, "|")>

<!--- the results are output to the screen in the form of an html numbered list. --->
<cfoutput>
<OL>
<cfloop index="i" from="1" to="#arrayLen(response_array)#">
	<LI>#response_array[i]# &nbsp;</LI>
</cfloop>
</OL>
<!--- individual elements of the array could be accessed to read certain
response fields.  For example, response_array[1] would return the Response
Code, response_array[3] would return the Response Reason Code.
For a list of response fields, please review the AIM Implementation Guide --->

</BODY>
</HTML>
</cfoutput>